syntax = "proto3";

package markov_backend;

service Continuation {
   rpc GetProbabilities (GetRequest) returns (ProbabilitiesResponse);
   rpc SetNextWord (PutRequest) returns (OKResponse);
   rpc Reset (InitRequest) returns (OKResponse);
   rpc Tokenize (TokenizeRequest) returns (TokenlistResponse);
}

message TokenizeRequest {
  string wholestring = 1;
}

message TokenlistResponse {
  repeated string tokens = 1;
}

message GetRequest {
}

message ProbabilitiesResponse {
  repeated ProbAndToken entries = 1;
}

message ProbAndToken {
  double prob = 1;
  string token = 2;
}

message PutRequest {
  string token = 1;
}

message OKResponse {
}

message InitRequest {
  string start = 1;
}